﻿@using CMSMVC4.MultiResource
@model CMSMVC4.Areas.Admin.Models.BanerModel

@{
    ViewBag.Title = "Baner";
    Layout = "~/Areas/Admin/Views/Shared/_Layout.cshtml";
}

<div class="row-fluid">
    <div class="span7" style="width: 100%">
        <div class="box paint color_12">
            <div class="title">
                <h4><span>Baner</span> </h4>
            </div>
            <div class="content" style="width: 65%">
                  @using (Html.BeginForm("Add", "Baner", FormMethod.Post, new { @class = "form-horizontal cmxform", autocomplete = "off" }))
                  {
                      <div class="form-row control-group row-fluid">
                          <label class="control-label span3"></label>
                          <div class="controls span7">
                              <span>@Admin.Top (998x113) @Admin.Left (245xauto) @Admin.Contact (312x128)</span>
                          </div>
                      </div>
                      <div class="form-row control-group row-fluid">
                          <label class="control-label span3">@Admin.Url<span class="help-block">@Admin.Url</span> </label>
                          <div class="controls span7">
                              <input type="text" name="Url" value="#" class="span12" placeholder="Url"/>
                          </div>
                      </div>
                      <div class="form-row control-group row-fluid">
                          <label class="control-label span3">@Admin.Images<span class="help-block">@Admin.Images</span> </label>
                          <div class="controls span7">
                              <input type="text" id="Name" name="Name" value="" class="span12" style="width: 60%" placeholder="Image"/>
                              <input id="Button1" type="button" value="@Admin.InsertPhoto" class="btn btn-large" style="height: 33px; float: right"/>
                          </div>
                      </div>
                      <div class="form-row control-group row-fluid">
                          <label class="control-label span3">@Admin.Location<span class="help-block">@Admin.Location</span></label>
                          <div class="controls span7">
                              <select data-placeholder="Choose a Type Support..." class="chzn-select" name="Location" id="sl">
                                  <option value=""></option>
                                  <option value="0">@Admin.Top</option>
                                  <option value="1">@Admin.Left</option>
                                  <option value="2">@Admin.Contact</option>
                              </select>
                              @Html.ValidationMessageFor(x => x.Location)
                          </div>
                      </div>
                      <div class="form-row control-group row-fluid" id="sl1" >
                          <label class="control-label span3">@Admin.PageL<span class="help-block">@Admin.PageL</span></label>
                          <div class="controls span7">
                              <select data-placeholder="Choose a Type Support..." class="chzn-select" name="Type">
                                  <option value=""></option>
                                  <option value="1">@Admin.GioiThieu</option>
                                  <option value="3">@Admin.ThietBi</option>
                                  <option value="2">@Admin.DichVu</option>
                                  <option value="4">@Admin.TinTuc</option>
                                  <option value="5">@Admin.DoiTac</option>
                                  <option value="6">@Admin.LienHe</option>
                              </select>
                              @Html.ValidationMessageFor(x => x.Type)
                          </div>
                      </div>
                      <div class="form-actions row-fluid">
                          <div class="span7 offset3">
                              <button type="submit" class="btn btn-primary">@Admin.SaveChange</button>
                          </div>
                      </div>
                  }
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function () {
        $("#Button1").click(function () {
            var finder = new CKFinder();
            finder.selectActionFunction = function (fileUrl) {
                $('#Name').val(fileUrl);
            };
            finder.popup();
        });
    })
</script>
<script>
    $(function () {
        $("#sl").change(function () {
            var v = $(this).val();
            if (v ==2) {
                $("#sl1").css({ 'display': 'none' });
            }
            else {
                $("#sl1").css({ 'display': 'block' });
            }
        });
    });
</script>

@*@if (Model != null)
{
    @Html.ValidationSummary()
    using (Html.BeginForm("Add", "Baner", FormMethod.Post))
    {
        @:Banner top:(998 X 113)
        <div>
            <img src="@Model.Urltop"/>
            @Html.HiddenFor(x => x.Idtop)
            | @Html.TextBoxFor(x => x.Urltop, new {placeholder = "url"})
            | @Html.TextBoxFor(x => x.Nametop, new {placeholder = "file"})
            <input id="Button1" type="button" value="chon anh" />
        </div>
        @:Baner Left:(215 X auto)
        <div>
            <img src="@Model.Urlleft"/>
            @Html.HiddenFor(x => x.Idleft)
            | @Html.TextBoxFor(x => x.Urlleft, new {placeholder = "url"})
            | @Html.TextBoxFor(x => x.Nameleft, new {placeholder = "file"})
            <input id="Button2" type="button" value="chon anh" />
        </div>
        @:Banner Lien He(312:128)
        <div>
            <img src="@Model.Urllienhe"/>
            @Html.HiddenFor(x => x.Idlienhe)
            | @Html.TextBoxFor(x => x.Urllienhe, new {placeholder = "url"})
            | @Html.TextBoxFor(x => x.Namelienhe, new {placeholder = "file"})
            <input id="Button3" type="button" value="chon anh" />
        </div>
        <input type="submit" value="Save" />
    }

@*}*@